home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Utilitaires divers / Images / RTrace 1.0 ƒ / RTrace-docs / SFF.txt < prev   
Encoding:
Text File  |  1992-10-08  |  7.3 KB  |  270 lines  |  [TEXT/ttxt]

  1. This document describes the SFF (Simple File Format) used on the
  2. RTRACE ray tracer (Version 7.3.2). This a plain text line oriented format,
  3. with a file inclusion capability. As present, it is very simple to read
  4. and write this format from languages like C and Pascal, which was my main
  5. concern...
  6.  
  7. (^ represents start of line!)
  8.  
  9. ***** Format SFF (Simple File Format) *****
  10. [Start of File]
  11. ^... Comment
  12. ^Eye(X Y Z)
  13. ^Look(X Y Z)
  14. ^Up(X Y Z)
  15. ^View_angle(H V) [1,89 degrees]
  16. ^... Comment
  17. ^Background(R G B)
  18. ^Ambient(R G B)
  19. ^... Comment
  20. ^Light_type(Type) Position(X Y Z) Bright(R G B) ...
  21.   |                                                                    |
  22.   |                  /---------------------------/
  23.   |                  |
  24.   V                V
  25.  1-POINT:
  26.  2-DIRECTIONAL: Direction(X Y Z) Angle(La) Light_Factor(Lf)
  27.  3-EXTENDED:    Radius(R) Samples(N)
  28. ^Etc
  29. ^<NL>
  30. ^... Comment
  31. ^Surface_type(Type) Color(R G B) ...
  32.   |                                                 |
  33.   |        /----------------------/
  34.   |        |
  35.  V       V
  36.  1-: Diffuse(R G B) Specular(R G B) Phong(Pf) Metalness(Mf) Trans.(R G B) 
  37.  2-: Smoothness(R G B) Metalness(R G B) Transmission(R G B) 
  38. ^Etc
  39. ^<NL>
  40. ^... Comment
  41. ^Object_type(Type) Surface_ID(S) Refraction(Re) ...
  42.   |                                                                  |
  43.   |                     /------------------------/
  44.   |                     |
  45.  V                    V
  46.  1-SPHERE:          Center(X Y Z) Radius(R)
  47.  2-PARALLELIPIPED:  Center(X Y Z) Size(X Y Z)
  48.  3-PATCH:           Origin(X Y Z) Scale(X Y Z) Filename(...)
  49.  4-CONE/CYLINDER:   Apex(X Y Z) Apex_Radius(Ra) Base(X Y Z)
  50.                     Base_Radius(Rb)
  51.  5-POLYGON:         Origin(X Y Z) Scale(X Y Z) Filename(...)
  52.  6-TRIANGLE:        Origin(X Y Z) Scale(X Y Z) Filename(...)
  53.  7-TEXT3D:          Filename(...)
  54.  64-TEXTURE:        see below
  55.  65-TRANSFORMATION: Object_ID(I)
  56.                     Transform(X1 Y1 Z1 W1 ... X4 Y4 Z4 W4)
  57.  66-CSG 0:          Surface_ID(S) Refraction(Re) (Union-0 Sub-1 Int-2)
  58.     CSG 1:          Next CSG member
  59.     CSG 2:          End of CSG
  60.  67-LIST 0:         Surface_ID(S) Refraction(Re)
  61.     LIST 1:         End of List
  62. ^Etc
  63. ^<NL>
  64. ^... Comment
  65. ^Texture_type(Type) Object_ID(I)
  66.   |                 Transform(X1 Y1 Z1 W1 ... X4 Y4 Z4 W4)
  67.   |                 ...
  68.   |                  |
  69.  V                 V
  70.  0-NULL:
  71.  1-CHECKER:   Surface_ID(S)
  72.  2-BLOTCH:    Scale(K) Surface_ID(S) [Filename(...) or -]
  73.  3-BUMP:      Scale(K)
  74.  4-MARBLE:    [Filename(...) or -]
  75.  5-FBM:       Offset(K) Scale(K) Omega(K) Lambda(L)
  76.               Threshold(K) Octaves(O)
  77.               [Filename(...) or -]
  78.  6-FBMBUMP:   Offset(K) Scale(K) Lambda(L) Octaves(O)
  79.  7-WOOD:      Color(R G B)
  80.  8-ROUND:     Scale(K)
  81.  9-BOZO:      Turbulence(K) [Filename(...) or -]
  82.  11-WAVES:    Frequency(K) Phase(K) Scale(K)
  83.  12-SPOTTED:  [Filename(...) or -]
  84.  13-DENTS:    Scale(K)
  85.  14-AGATE:    [Filename(...) or -]
  86.  15-WRINKLES: Scale(K)
  87.  16-GRANITE:  [Filename(...) or -]
  88.  17-GRADIENT: Turbulence(K) Direction(X Y Z)
  89.               [Filename(...) or -]
  90.  18-IMAGEMAP: Turbulence(K) Mode(K) Axis(X Y) Filename(...)
  91.  19-GLOSS:    Scale(K)
  92.  20-BUMP3D:   Scale(K) Size(K)
  93. ^<NL>
  94. ^... Comments
  95. [End of File]
  96.  
  97. 1. Valid ranges or data
  98.  
  99. RGB must be in [0,1[
  100. (Note: RGB brightness of lights may be between ]0,300[;
  101. negative values mean to not attenuate with distance)
  102. XYZ must be in [-10000,10000]
  103. Factor must be in [0,300[
  104.  
  105. Filename must a valid filename for the operating system, or then '-', in
  106. which case data is read from the standard input or the same SFF stream.
  107.  
  108. 2. Patch specification
  109.  
  110. File format for PATCH (bicubic 4-sided patch):
  111. [Start]
  112. Patch_1_Index(1 2 3 4 5 6 7 8 9 10 11 12)
  113. Patch_2
  114. Etc
  115. <NL>
  116. Patch_1_Index_1_Coords(X Y Z)
  117. Patch_1_Index_2_Coords(X Y Z)
  118. Etc
  119. <NL>
  120. ...
  121. [End]
  122.  
  123. 3. Polygon specification
  124.  
  125. File format for POLYGON (n-sided planar polygon):
  126. [Start]
  127. Polygon_1_Vertex_Number Polygon_1_Index(1 2 3 ...)
  128. Polygon_2
  129. Etc
  130. <NL>
  131. Polygon_1_Index_1_Coords(X Y Z)
  132. Polygon_1_Index_2_Coords(X Y Z)
  133. Etc
  134. <NL>
  135. ...
  136. [End]
  137.  
  138. 4. Triangle specification
  139.  
  140. File format for TRIANGLE (3-sided polygon with vertex normals):
  141. [Start]
  142. Triangle_1_Vertice_1(X Y Z) Normal_1(X Y Z) Vertice_2(X Y Z) Normal_2(X Y Z) ...
  143. Triangle_2
  144. <NL>
  145. ...
  146. [End]
  147.  
  148. 5. An example
  149.  
  150. [Start of File]
  151. View
  152. 25 25 7         - Eye point
  153. 0 0 0           - Look point
  154. 0 1 0           - Up vector
  155. 30 30           - View angles
  156. Colors
  157. 0.196 0.6 0.8   - Background (Sky Blue)
  158. 0.1 0.1 0.1     - Ambient light
  159. Lights
  160. 1 0 60 60 0.9 0.9 0.9   - Point Light 1
  161. 1 20 40 -7 0.9 0.9 0.9  - Point Light 2
  162.  
  163. Surfaces
  164. 1 0.6 0.8 0.196 0.99 0.99 0.99 0 0 0 0 0 0 0 0             - Yellow Green
  165. 1 0.9 0.9 0.9 0.5 0.5 0.5 0.5 0.5 0.5 50 1 0 0 0           - White
  166. 1 0.5 0.5 0.5 0.1 0.1 0.1 0.1 0.1 0.1 200 0.7 0.8 0.8 0.8  - Grey
  167. 1 0.9 0.2 0.2 0.99 0.99 0.99 0 0 0 0 0 0 0 0               - Red
  168.  
  169. Objects
  170. 5 1 1.0 0 0 0 15 15 15  - Polygon
  171. 4 1 2 3 4
  172.  
  173. 1 0 1
  174. 1 0 -1
  175. -1 0 -1
  176. -1 0 1
  177.  
  178. 2 2 1.0 0 2 0 7 2 3     - Parallelipiped
  179. 2 3 1.5 0 5 10 3 5 3    - Parallelipiped
  180. 1 4 1.0 7 15 -7 3       - Sphere
  181.  
  182. Textures
  183. 2 1 2 0 0 0 0 2 0 0 0 0 2 0 0 0 0 1 0.4 4                 - Blotch
  184. 4 2 5 0 0 0 0 5 0 0 0 0 5 0 0 0 0 1                       - Marble
  185. 5 4 10 0 0 0 1 10 0 0 1 1 10 0 0 0 0 1 0 0.6 0.5 2 0.1 6  - FBM Bump
  186.  
  187. End
  188. Demo / 11-OCT-1989 / Antonio Costa
  189. [End of File]
  190.  
  191. To ray trace without textures, do
  192.  
  193.         rtrace demo.sff demo.pic >&demo.log
  194.  
  195. else, do
  196.  
  197.         rtrace t2 demo.sff demo.pic >&demo.log
  198.  
  199. Another example with INESC symbol:
  200. [Start of File]
  201. View
  202. 45.0 45.0 81.0  - Eye point
  203. 45.0 45.0 -81.0 - Look point
  204.  0.0  1.0  0.0  - Up vector
  205. 30 30           - View angles
  206. Colors
  207. 0.196 0.6 0.8 - Background (Sky Blue)
  208. 0.3 0.3 0.3   - Ambient
  209. Lights
  210. 1  0.0 100.0 100.0 1 1 1 - Light 1 (White)
  211. 1 90.0 100.0 100.0 1 1 0 - Light 2 (Yellow)
  212.  
  213. Surfaces
  214. 1 0.557 0.420 0.137 0.8 0.7 0.7 0.2 0.3 0.3 30 0.8 0 0 0 - Surf 1 (Steel Red)
  215. 1 0.137 0.420 0.557 0.5 0.5 0.6 0.5 0.5 0.4 5 0.2 0 0 0  - Surf 2 (Steel Blue)
  216. 1 0.600 0.800 0.200 0.9 0.9 0.9 0.0 0.0 0.0 1 0 0 0 0    - Surf 3 (Matte Green)
  217.  
  218. Objects
  219. 1 1 1.0 10.0 09.5 0.0 4.5 - Sphere
  220. 1 1 1.0 10.0 26.5 0.0 4.5
  221. 1 1 1.0 20.0 63.5 0.0 4.5
  222. 1 1 1.0 20.0 80.0 0.0 4.5
  223. 1 1 1.0 40.0 09.5 0.0 4.5
  224. 1 1 1.0 40.0 26.5 0.0 4.5
  225. 1 1 1.0 40.0 43.5 0.0 4.5
  226. 1 1 1.0 50.0 80.0 0.0 4.5
  227. 1 1 1.0 60.0 53.0 0.0 4.5
  228. 1 1 1.0 70.0 09.5 0.0 4.5
  229. 1 1 1.0 70.0 43.5 0.0 4.5
  230. 4 2 1.0 10.0 30.0 0.0 1.5 10.0 70.0 0.0 1.5 - Cylinder
  231. 1 2 1.0 10.0 70.0 0.0 1.5
  232. 4 2 1.0 10.0 70.0 0.0 1.5 17.5 77.5 0.0 1.5
  233. 4 2 1.0 12.5 12.0 0.0 1.5 20.0 19.5 0.0 1.5
  234. 1 2 1.0 20.0 19.5 0.0 1.5
  235. 4 2 1.0 20.0 19.5 0.0 1.5 20.0 60.0 0.0 1.5
  236. 4 2 1.0 22.5 61.0 0.0 1.5 37.5 46.0 0.0 1.5
  237. 4 2 1.0 37.5 12.0 0.0 1.5 30.0 19.5 0.0 1.5
  238. 1 2 1.0 30.0 19.5 0.0 1.5
  239. 4 2 1.0 30.0 19.5 0.0 1.5 30.0 33.5 0.0 1.5
  240. 1 2 1.0 30.0 33.5 0.0 1.5
  241. 4 2 1.0 30.0 33.5 0.0 1.5 37.5 41.0 0.0 1.5
  242. 4 2 1.0 30.0 26.5 0.0 1.5 36.5 26.5 0.0 1.5
  243. 4 2 1.0 40.0 47.0 0.0 1.5 40.0 70.0 0.0 1.5
  244. 1 2 1.0 40.0 70.0 0.0 1.5
  245. 4 2 1.0 40.0 70.0 0.0 1.5 47.5 77.5 0.0 1.5
  246. 4 2 1.0 42.5 12.0 0.0 1.5 50.0 19.5 0.0 1.5
  247. 1 2 1.0 50.0 19.5 0.0 1.5
  248. 4 2 1.0 50.0 19.5 0.0 1.5 50.0 43.0 0.0 1.5
  249. 1 2 1.0 50.0 43.0 0.0 1.5
  250. 4 2 1.0 50.0 43.0 0.0 1.5 57.5 50.5 0.0 1.5
  251. 4 2 1.0 67.5 12.0 0.0 1.5 60.0 19.5 0.0 1.5
  252. 1 2 1.0 60.0 19.5 0.0 1.5
  253. 4 2 1.0 60.0 19.5 0.0 1.5 60.0 33.5 0.0 1.5
  254. 1 2 1.0 60.0 33.5 0.0 1.5
  255. 4 2 1.0 60.0 33.5 0.0 1.5 67.5 41.0 0.0 1.5
  256. 5 3 1.0 0.0 4.0 0.0 200.0 200.0 200.0 - Polygon
  257. 4 1 2 3 4
  258.  
  259.  1.0 0.0  1.0
  260.  1.0 0.0 -1.0
  261. -1.0 0.0 -1.0
  262. -1.0 0.0  1.0
  263.  
  264.  
  265. End
  266. INESC Logo / 23-FEB-1989 / Antonio Costa
  267. [End of File]
  268.  
  269. INESC-Norte, 22 July 1992.
  270.